import axios from 'axios';


const API_BASE_URL = '/api/student'; // Proxy path
export const fetchStudentInfo = async (token) => {
    try {
        const response = await axios.get('/api/student/studentInfo', {
            headers: {
                Authorization: token // 传递 Token
            }
        });
        return response.data;
    } catch (error) {
        throw new Error('Error fetching student info');
    }
};


export const updateStudentInfo = async (data, token) => {
    try {
        const response = await axios.put('/api/student/update', data, {
            headers: {
                Authorization: token // 传递 Token
            }
        });
        return response.data;
    } catch (error) {
        throw new Error('Error updating student info');
    }
};
